//
//  BaseTableViewCell.m
//  dzm
//
//  Created by dzmmac on 15/3/17.
//  Copyright (c) 2015年 dzmmac. All rights reserved.
//

#import "BaseTableViewCell.h"
#import "MainInfoTitleFields.h"

@implementation BaseTableViewCell

+ (id)getInstanceForNib{
    NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:[self cellIdentifier] owner:nil options:nil];
    return  [nibs lastObject];
}

+ (NSString *)cellIdentifier{
    return NSStringFromClass([self class]);
}

+ (id)cellForTableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NSString *cellID = [self cellIdentifier];
    return  [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
}

- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

-(NSAttributedString *)getPrice:(NSString *)price leftText:(NSString *)leftText leftSymbol:(NSString *)leftSymbol{
    NSMutableArray *mutableString = [[NSMutableArray alloc ] init];
    [mutableString addObject:[MainInfoTitleFields getInstaceWithText:leftText hexColor:GLOBLE_GRAY_COLOR_5_HEX fontSize:@"10"]];
    [mutableString addObject:[MainInfoTitleFields getInstaceWithText:leftSymbol hexColor:GLOBLE_ORANGE_COLOR_HEX fontSize:@"10"]];
    [mutableString addObject:[MainInfoTitleFields getInstaceWithText:price hexColor:GLOBLE_ORANGE_COLOR_HEX fontSize:@"16"]];
    return [CommoneTools getAttributeString:mutableString];
}

+(void)setBusLineStartLocationString:(NSString *)location startStationType:(NSString *)startStationType label:(UILabel *)label{
   
    if (startStationType) {
        label.attributedText = [CommoneTools getBusLineStartLocationString:location extion:[NSString stringWithFormat:@"-%@",startStationType]];
    }else{
        label.text = location;
    }
}

@end
